/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.risk.control.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hopes.bizz.risk.control.dto.RiskControlMeasureDTO;
import com.hopes.bizz.risk.control.dto.RiskControlMeasureExcelDTO;
import com.hopes.bizz.risk.control.entity.RiskControlMeasureEntity;
import com.hopes.bizz.risk.control.vo.RiskControlMeasureExcelVO;
import com.hopes.bizz.risk.control.vo.RiskControlMeasureVO;
import com.hopes.bizz.risk.control.vo.RiskDetailExcelVO;
import com.hopes.bizz.risk.control.vo.RiskIdentifyExcelVO;
import com.hopes.boss.common.core.util.R;
import com.hopes.boss.common.service.ExcelService;
import org.springframework.validation.BindingResult;

import javax.servlet.http.HttpServletResponse;
import java.util.Collection;
import java.util.List;

/**
 * 风险管控措施
 *
 * @author pig
 * @date 2023-07-19 16:16:03
 */
public interface RiskControlMeasureService extends ExcelService<RiskControlMeasureExcelDTO, RiskControlMeasureExcelVO, RiskControlMeasureEntity> {

    /* 分页查询 */
    Page<RiskControlMeasureVO> listPage(Page<RiskControlMeasureVO> page, RiskControlMeasureDTO riskControlMeasureDTO);

    /* 分页查询 包含 任务配置 */
    Page<RiskControlMeasureVO> listWithTaskPage(Page<RiskControlMeasureVO> page, RiskControlMeasureDTO riskControlMeasureDTO);

    /* 保存 */
    boolean save(RiskControlMeasureEntity riskControlMeasureEntity);

    /* 修改 */
    boolean updateById(RiskControlMeasureEntity riskControlMeasureEntity);

    /**
     * 风险辨识列表
     * @param riskUnitId 风险单元Id
     * @return           列表数据
     */
    List<RiskControlMeasureVO> listIdentify(Long riskUnitId);

    /**
     * 风险管控清单列表
     * @param riskControlMeasureDTO  过滤对象
     * @return                       清单列表数据
     */
    List<RiskControlMeasureVO> listDetailed(RiskControlMeasureDTO riskControlMeasureDTO);


    /**
     * 批量删除
     * @param list  删除id集合
     * @return      结果
     */
    boolean removeBatchByIds(Collection<?> list);

    /**
     * 导入风险辨识 Excel
     * @param riskIdentifyExcelVOList  风险辨识数据
     * @return
     */
    R importExcelIdentify( Long riskUnitId, List<RiskIdentifyExcelVO> riskIdentifyExcelVOList, BindingResult bindingResult) throws Exception;

    /**
     * 导入风险管控清单 Excel
     * @param riskDetailExcelVOList  风险管控清单
     * @return
     */
    R importExcelDetail(List<RiskDetailExcelVO> riskDetailExcelVOList, BindingResult bindingResult) throws Exception;

    /**
     * 导出风险辨识管控
     * @param riskControlMeasureDTO 过滤条件
     */
    void exportExcelIdentify(RiskControlMeasureDTO riskControlMeasureDTO, HttpServletResponse response) throws Exception;

    /**
     * 导出风险管控清单
     * @param riskControlMeasureDTO 过滤条件
     */
    void exportExcelDetail(RiskControlMeasureDTO riskControlMeasureDTO, HttpServletResponse response) throws Exception;

    // 根据风险单元ids集合
    List<RiskControlMeasureEntity> getByRiskUnitIdList(List<Long> riskUnitIdList);
}
